<template>
	<p>加载中</p>
</template>

<script>
	import wx from 'weixin-webview-jssdk'
	export default {
		data() {
			return {
				prevPageResponse: {}
			}
		},
		onLoad(option) {
			this.prevPageResponse = option
			wx.navigateBack({ delta: 1 })
		},
		onUnload() {
			// 关闭页面时调用的生命周期
			const pages = getCurrentPages()
			const prevPage = pages[pages.length - 2] // 上一个页面，也就是页面A
			if (prevPage.$vm.callback != undefined) {
				prevPage.$vm.callback({
					response: this.prevPageResponse,
					method: 'passToA'
				})
			}
		}
	}
</script>

<style scoped></style>
